package com.agenda.model;

import com.agenda.interfaces.Storable;

public class Usuario implements Storable {

	private String loginEmail;

	private String senha;

	public String getLoginEmail() {
		return loginEmail;
	}

	public void setLoginEmail(String loginEmail) {
		this.loginEmail = loginEmail;
	}

	public String getSenha() {
		return senha;
	}

	public void setSenha(String senha) {
		this.senha = senha;
	}

	@Override
	public String toString() {
		return loginEmail;
	}

	public boolean compararLogin(Usuario usuario) {
		return loginEmail.equals(usuario.getLoginEmail()) && senha.equals(usuario.getSenha());
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((loginEmail == null) ? 0 : loginEmail.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Usuario other = (Usuario) obj;
		if (loginEmail == null) {
			if (other.loginEmail != null)
				return false;
		} else if (!loginEmail.equals(other.loginEmail))
			return false;
		return true;
	}

}
